<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// +----------------------------------------------------------------------
// | 缓存设置
// +----------------------------------------------------------------------

$conf = [
    // 驱动方式
    'type'   => 'File',
    // 缓存保存目录
    'path'   => '',
    // 缓存前缀
    'prefix' => 'ydoc@',
    // 缓存有效期 0表示永久缓存
    'expire' => 0,
];

//redis驱动
$type = env('APP.CACHE_TYPE', 'file');
if ($type == 'redis') {
    $conf = array_merge($conf, [
        'type' => 'redis',
        'host' => env('REDIS.HOSTNAME', '127.0.0.1'),
        'port' => env('REDIS.PORT', '6379'),
    ]);
}

return $conf;